<?php
	header("content-type:text/html;chart=utf8");
	inculde_once("Classes/PHPExcel.php");
	$dsn ="mysql:host:127.0.0.1;dbname=;charset = utf8";
	$pdo = new PDO($dsn,'root','root');
	$sql = "select * from user";
	$res = $pdo->query($sql)->fetchAll(PDO::FETCH_ASSOC);
	$starttime = $res[0]['statttime'];
	$statttime = strtotime($statttime);
	$time = $statttime-time();
	$hour = floor($time/3600);
	$sec = $time-$hour*3600-$min*60;
	echo json_encode(array('hour'=>$hour,'min'=>$min,'sec'=$sec));
	?>